SQL QuickStart Guide by Walter Shields

SQL QuickStart Guide by Walter Shields

Author:Walter Shields [Shields, Walter]
Language: eng
Format: epub
Publisher: ClydeBank Media LLC
Published: 2020-03-06T23:23:39+00:00


SELECT i.InvoiceId, c.CustomerId, c.Name, c.Address, i.InvoiceDate, i.BillingAddress, i.Total FROM invoices AS i LEFT OUTER JOIN customers AS c ON i.CustomerId = c.CustomerId

With a left outer join, the “outer” keyword is optional.

When we look at the output of our left join, we see that the SQL browser has added null data to our result set. Remember that we have no information in the customers table about Customer 6. Adding null data is how the SQL browser handles the fact that we were trying to match five records from invoices to only four records from customers. Left joins are useful because they allow us to see discrepancies in our data. We can produce lists of customers that have not generated invoices or search for data that has been removed in the right table but still exists in the left table.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.